package jp.sourceforge.akjrcp.dropsomething.actions;

import java.io.File;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.dropsomething.DropsomethingAction;
import jp.sourceforge.akjrcp.dropsomething.FFMpegSettingPage;
import jp.sourceforge.akjrcp.ffmpeg.SimpleCommandExecuter;

public class CustomAction implements DropsomethingAction{

	public void exec(File input,File output) {
		//
		String command=Akj_betasPlugin.getDefault().getPluginPreferences().getString(FFMpegSettingPage.DROPFFMPEG_CUSTOM_COMMAND);
		if(command.length()>0){
			
			command=command.replace("${INPUT}",input.getAbsolutePath());
			command=command.replace("${OUTPUT}",output.getAbsolutePath());
			
		
		SimpleCommandExecuter executer=new SimpleCommandExecuter(command);
		executer.setPrinter(Akj_betasPlugin.getDefault().getProcessPrinter());
		executer.execute();
		}
	}

}
